<?php
/**
 * Created by PhpStorm.
 * User: cuipengyu
 * Date: 2018-12-29
 * Time: 14:35
 */
namespace app\admin\command;


use think\console\Command;
use think\Db;
use think\Log;
use tp5er\Backup;

class DbBackupTask extends Command
{
    protected function configure()
    {
        $this->setName('dbBackupTask')->setDescription('Now backup database ');
    }

    protected function execute(Input $input, Output $output)
    {

        $bc = new Backup(config('dbbackup'));
        $file=['name'=>date('Ymd-His'),'part'=>1];
        $bc->setFile($file)->backupAll();

    }

}